package com.tsing.cedap.common.utils;

import org.apache.tomcat.util.codec.binary.Base64;

public class DocumentUtil {

    public static String imgToBase64(byte[] file, String fileType) {
        return "data:image/" + fileType + ";base64," + Base64.encodeBase64String(file);
    }

    public static String pdfToBase64(byte[] file) {
        return "data:application/pdf;base64," + Base64.encodeBase64String(file);
    }

    public static String svgToBase64(byte[] file) {
        return "data:image/svg+xml;base64," + Base64.encodeBase64String(file);
    }

}
